﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace suirui.ZhuMu.Entity.Migrations
{
    public partial class first1228 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Health",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: true),
                    CreateUser = table.Column<string>(maxLength: 32, nullable: true),
                    Status = table.Column<int>(nullable: true),
                    Sort = table.Column<int>(nullable: true),
                    Remark = table.Column<string>(maxLength: 200, nullable: true),
                    UserId = table.Column<long>(nullable: false),
                    Temperature = table.Column<decimal>(nullable: false),
                    TemperaturePhoto = table.Column<string>(nullable: false),
                    IsFever = table.Column<bool>(nullable: false),
                    IsCough = table.Column<bool>(nullable: false),
                    IsPharyngalgia = table.Column<bool>(nullable: false),
                    IsBreath = table.Column<bool>(nullable: false),
                    IsSmell = table.Column<bool>(nullable: false),
                    IsHeadache = table.Column<bool>(nullable: false),
                    IsVomit = table.Column<bool>(nullable: false),
                    IsTired = table.Column<bool>(nullable: false),
                    IsSeeDoctor = table.Column<bool>(nullable: false),
                    SeeDoctorRecord = table.Column<string>(maxLength: 300, nullable: true),
                    IsTouchPatient = table.Column<bool>(nullable: false),
                    TouchPatientDetail = table.Column<string>(maxLength: 300, nullable: true),
                    IsTouchFever = table.Column<bool>(nullable: false),
                    TouchFeverDetail = table.Column<string>(maxLength: 300, nullable: true),
                    IsGoPublicPlace = table.Column<bool>(nullable: false),
                    GoPublicPlaceDetail = table.Column<string>(maxLength: 300, nullable: true),
                    IsVaccination = table.Column<bool>(nullable: false),
                    VaccinationPhoto = table.Column<string>(maxLength: 300, nullable: true),
                    TestReportPhoto = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Health", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "user",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false, comment: "登录的用户ID")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: true),
                    CreateUser = table.Column<string>(maxLength: 32, nullable: true),
                    Status = table.Column<int>(nullable: true),
                    Sort = table.Column<int>(nullable: true),
                    Remark = table.Column<string>(type: "varchar(255)", maxLength: 200, nullable: true, defaultValueSql: "''", comment: "备注"),
                    NOCName = table.Column<string>(maxLength: 30, nullable: false),
                    Name = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false, defaultValueSql: "''", comment: "用户名"),
                    Sex = table.Column<short>(nullable: false),
                    CardNumber = table.Column<string>(maxLength: 20, nullable: false),
                    Phone = table.Column<string>(type: "varchar(20)", maxLength: 15, nullable: false, defaultValueSql: "''", comment: "手机号"),
                    Role = table.Column<short>(nullable: false, comment: "角色"),
                    Password = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false, defaultValueSql: "''", comment: "登录密码"),
                    HeadPhoto = table.Column<string>(type: "text", nullable: true, comment: "头像路径"),
                    Email = table.Column<string>(nullable: true),
                    EntryTime = table.Column<DateTime>(nullable: false),
                    DepartureTime = table.Column<DateTime>(nullable: false),
                    EntryAddress = table.Column<string>(nullable: false),
                    LastLoginTime = table.Column<DateTime>(nullable: false),
                    LastLoginIP = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_user", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Health");

            migrationBuilder.DropTable(
                name: "user");
        }
    }
}
